{{-- 模板名字 --}}
@extends('Layout/HomeBase')



{{-- 页面名字 --}}
@section('title', '商城主页')




{{-- 加载css文件 --}}
@section('css')
<link href="{{asset('Home/css/amazeui.css')}}" rel="stylesheet" type="text/css" />
<link href="{{asset('Home/css/admin.css')}}" rel="stylesheet" type="text/css" />
<link href="{{asset('Home/css/demo.css')}}" rel="stylesheet" type="text/css" />
<link href="{{asset('Home/css/sustyle.css')}}" rel="stylesheet" type="text/css" />
@endsection




{{-- 网页主体 --}}
@section('main')


<div class="clear"></div>



<div class="take-delivery">
 <div class="status">
   <h2>您已成功付款</h2>
   <div class="successInfo">
     <ul>

       <li>付款金额<em>¥{{$money}}</em></li>
       <div class="user-info">
         <p>收货人：{{$man}}</p>
         <p>联系电话：{{$phone}}</p>
         <p>收货地址：{{$address}}</p>
       </div>
             请认真核对您的收货信息，如有错误请联系客服

     </ul>
     <div class="option">
       <input type="hidden" name="id" value="{{$id}}">
       <button type="button" name='pay' class="btn btn-success" name="button">确认付款</button>
     </div>
    </div>
  </div>
</div>


@endsection



{{-- 页脚JS代码 --}}
@section('bottom-js')
<script type="text/javascript" src="{{asset('Home/js/jquery-1.7.min.js')}}"></script>
<script>
  $("button[name='pay']").click(function () {
    var id = $(this).parent().children("input(name='id')").val();
    var token  = "{{csrf_token()}}";
    $.ajax({
        type:'post',
        url:"{{url('/payMoney')}}",
        data: {"id":id, "_token":token},
        dataType:'json',
        success:function(data){
          if(data.code == 2000) {
            alert(data.msg);
            location.href= "{{url('/')}}";
          }else{
            alert(data.msg);
          }
        }
    });
  })
</script>
@endsection
